<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <title>景区数据处理</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
    crossorigin="anonymous">
  <link href="https://cdn.bootcss.com/bootstrap-fileinput/4.5.1/css/fileinput.min.css" rel="stylesheet">
  <style>
    #container {
      height: 500px;
    }
  </style>
</head>

<body>
  <div class="container">
    <div class="row"></div>
    <div class="row pull-right">
        <button type="button" class="btn btn-warning"  data-toggle="modal" data-target="#myModal">开始处理</button>
    </div>
    <div class="row">
      <table class="table table-bordered">
        <thead>
          <tr>
            <th>#</th>
            <th>景区名称</th>
            <th>省</th>
            <th>市</th>
            <th>区</th>
            <th>景区级别</th>
            <th>操作记录</th>
          </tr>
        </thead>
        <tbody>
          {% for f in list %}
          <tr>
            <th scope="row">{{f.id}}</th>
            <td>{{f.name}}</td>
            <td>{{f.province}}</td>
            <td>{{f.city}}</td>
            <td>{{f.district}}</td>
            <td>{{f.levle}}</td>
            <td>
              {% if f.status === 2 %}
                已自动处理
              {% elif f.status === 1 %}
              已手动确认
              {% else %}
              待确认
              {% endif %}
            </td>
          </tr>
          {% endfor %}
        </tbody>
      </table>
    </div>

    <!-- Modal -->
    <div class="modal fade bs-example-modal-lg" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog modal-lg" role="document">
          
          <div class="modal-content">
            <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
              <h4 class="modal-title" id="myModalLabel">Modal title</h4>
            </div>
            <div class="modal-body">
              <div class="container">
                <div class="row">
                  搜索关键词: <span class="label label-info">info</span>
                </div>
                <div class="row">
                  省: <span class="label label-info">info</span>
                  市: <span class="label label-info">info</span>
                  区: <span class="label label-info">info</span>
                </div>
              </div>
              <div id="container"></div>
            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
              <button type="button" class="btn btn-primary">Save changes</button>
            </div>
          </div>
        </div>
      </div>
  </div>
  <script src="//webapi.amap.com/maps?v=1.4.11&key=8f723fb25a4e9cbe592b9e17ffdcaaa3"></script>
  <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
    crossorigin="anonymous"></script>
  <script src="https://cdn.bootcss.com/bootstrap-fileinput/4.5.1/js/plugins/piexif.min.js"></script>
  <script src="https://cdn.bootcss.com/bootstrap-fileinput/4.5.1/js/plugins/sortable.min.js"></script>
  <script src="https://cdn.bootcss.com/bootstrap-fileinput/4.5.0/js/plugins/purify.min.js"></script>
  <script src="https://cdn.bootcss.com/bootstrap-fileinput/4.5.1/js/fileinput.js"></script>
  <script src="https://cdn.bootcss.com/bootstrap-fileinput/4.5.1/themes/fa/theme.js"></script>
  <script src="https://cdn.bootcss.com/bootstrap-fileinput/4.3.1/js/fileinput_locale_zh.js"></script>
  <script>
    $("#myModal").on('shown.bs.modal', function() {
      console.log(123)
      var marker, map = new AMap.Map("container", {
        resizeEnable: true,
        center: [116.397428, 39.90923],
        zoom: 13
      });

      // 实例化点标记
      function addMarker() {
          marker = new AMap.Marker({
              icon: "//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png",
              position: [116.406315,39.908775],
              offset: new AMap.Pixel(-13, -30)
          });
          marker.setMap(map);
      }

      function updateMarker() {

          if (!marker) {
              return;
          }

          // 自定义点标记内容
          var markerContent = document.createElement("div");

          // 点标记中的图标
          var markerImg = document.createElement("img");
          markerImg.className = "markerlnglat";
          markerImg.src = "//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-red.png";
          markerContent.appendChild(markerImg);

          // 点标记中的文本
          var markerSpan = document.createElement("span");
          markerSpan.className = 'marker';
          markerSpan.innerHTML = "Hi，我被更新啦！";
          markerContent.appendChild(markerSpan);

          marker.setContent(markerContent); //更新点标记内容
          marker.setPosition([116.391467, 39.927761]); //更新点标记位置
      }

      // 清除 marker
      function clearMarker() {

        if (marker) {
            marker.setMap(null);
            marker = null;
        }
    }
    })
  </script>
</body>

</html>